function Fetch(url,type,data,callback,obj){
	if(window.fetch){
		console.log(data);
        fetch(url,{
            method: type,
            headers: {
                'Content-Type': 'application/x-www-form-urlencoded;application/json'
                // 'Content-Type': 'application/json; charset=utf-8'
            },
            body: JSON.stringify(data)
        })
        .then(function(res) {
            if(res.ok){
                res.json().then(function(data){
               //  	var load = document.getElementById('loading');
               //  	if(data.team.length){
	              //   	var newPage = ++ obj.state.page;
	              //   	obj.state.data.team.push(data.team);
	              //   	console.log(obj.state.data);
               //  		// console.log(newData);
	            		// obj.setState({'data':obj.state.data,'page': newPage})
	            		// load.className='hide';
               //  	}else{
               //  		load.innerHTML('没有更多了~_~');
               //  	}
               		if(typeof callback == 'function'){
               			obj.callback(data);
               		}
                });
            }else{
            	alert('操作失败！');
            }
        },function(e){
            alert('操作失败！');
        })
    }else{
        var xhr = new XMLHttpRequest();
        xhr.open(type,url,true);
        xhr.onreadystatechange = function(){
            if(xhr.readyState == 4){
                if(xhr.status >= 200 && xhr.status < 300 || xhr.status == 304){
                	if(data.team.length){
	                	var newPage = ++ obj.state.page;
	            		obj.setState({'data':data,'page': newPage})
                	}else{
                		document.getElementById('loading').innerHTML('没有更多了~_~');
                	}
                }else{
                    alert('操作失败！');
                }
            }
        }
    }
}
export default Fetch;